﻿using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;
using Castle.Components.Validator;
using MiragePWF.NH.Validation;
using Wolfut.MirageEE.Kernal.Common;

namespace Wolfut.MirageEE.Domain.Common
{   [Serializable]
    public class Account : PersistentObjectWithGuid
    {
        #region AccountCode
        [Property("ACCOUNT_CODE")]
        [ValidateIsUniqueInSameTransactionWithString(false, "数据库已经存在相同的帐户代码！")]
        [ValidateNonEmpty, ValidateLength(0,100, "帐户代码超长！")]

        public virtual string AccountCode
        {
            get
            {
                return accountCode;
            }
            set
            {
                accountCode = value;
            }
        }

        private string accountCode;
        #endregion
        #region AccountName
        [Property("ACCOUNT_NAME")]
        [ValidateIsUniqueInSameTransactionWithString(false, "数据库已经存在相同的帐户名称！")]

        [ValidateNonEmpty, ValidateLength(0, 40, "帐户名称超长！")]
        public virtual string AccountName
        {
            get
            {
                return accountName;
            }
            set
            {
                accountName = value;
            }
        }

        private string accountName;
        #endregion
        #region AccountName
        [Property("ACCOUNT_CATEGORY")]
        [ValidateNonEmpty]
        public virtual string AccountCategory
        {
            get
            {
                return accountCategory;
            }
            set
            {
                accountCategory = value;
            }
        }

        private string accountCategory;
        #endregion
        #region 逻辑删除
        private Boolean isDeleted;
        [Property("IS_DELETED")]
        public virtual Boolean IsDeleted
        {
            get
            {
                return isDeleted;
            }
            set
            {
                isDeleted = value;
            }
        }
        #endregion
    }
}

